<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>数组合并</title>
	</head>
	<body>
		<h4>题目描述</h4>
		<p>合并数组 arr1 和数组 arr2。不要直接修改数组 arr，结果返回新的数组</p>
		<span>concat([1, 2, 3, 4], ['a', 'b', 'c', 1])</span>
		<script type="text/javascript">
			function demo9(arr1,arr2){
				var arr1New=[],arr2New=[];
				arr1New=arr1.map(function(index){
					return index;
				})
				arr2New=arr2.map(function(index){
					return index;
				})
				return arr1New.concat(arr2New);
			}
			write(demo9([1, 2, 3, 4], ['a', 'b', 'c', 1]))
			function write(text){
				document.write("<br /><span>答案:"+text+"</span>")
			}
//			function concat(arr1,arr2){
//				return arr1.concat(arr2);
//			}
//			console.log(concat([1, 2, 3, 4], ['a', 'b', 'c', 1]))
		</script>
	</body>
</html>
